/*

/* eslint-disable @typescript-eslint/no-var-requires */

const StyleLintPlugin = require("stylelint-webpack-plugin");

module.exports = {
  transpileDependencies: true,
  lintOnSave: false,
  publicPath: "./",
  css: {
    loaderOptions: {
      sass: {
        prependData: `
          @import '~@/assets/styles/variable.scss';
          @import '~@/assets/styles/mixin.scss';
        `,
      },
      less: {
        lessOptions: {
          modifyVars: {
            "primary-color": "#d14424",
            "text-color": "#41464b",
            "font-size-base": "13px",
            "border-radius-base": "2px",
          },
          javascriptEnabled: true,
        },
      },
    },
  },
  configureWebpack: {
  },
  pwa: {
    name: "云抖屏",
    themeColor: "#d14424",
    iconPaths: {
      faviconSVG: null,
      favicon32: "icons/favicon.png",
      favicon16: "icons/favicon.png",
      appleTouchIcon: "icons/favicon.png",
      maskIcon: null,
      msTileImage: null,
    },
    manifestOptions: {
      name: "云抖屏",
      short_name: "云抖屏",
      theme_color: "#d14424",
      icons: [
        {
          src: "icons/favicon.png",
          sizes: "192x192",
          type: "image/png",
        },
        {
          src: "icons/favicon.png",
          sizes: "512x512",
          type: "image/png",
        },
        {
          src: "icons/favicon.png",
          sizes: "192x192",
          type: "image/png",
          purpose: "maskable",
        },
        {
          src: "icons/favicon.png",
          sizes: "512x512",
          type: "image/png",
          purpose: "maskable",
        },
      ],
      start_url: ".",
      display: "standalone",
      background_color: "#000000",
    },
    workboxOptions: {
      runtimeCaching: [
        {
          urlPattern: /.*/,
          handler: "NetworkFirst",
          options: {
            cacheName: "云抖屏",
            expiration: {
              maxAgeSeconds: 60 * 60 * 10,
            },
            cacheableResponse: {
              statuses: [0, 200],
            },
          },
        },
      ],
      include: [/\.ttf$/],
      skipWaiting: true,
    },
  },
};
